#include<bits/stdc++.h>
using namespace std;
int main(){
    int c;cin>>c;
    if(c%2==0&&c>4&&c<=12)cout<<1;
    else cout<<0;
    cout<<" ";
    if(c%2==0)
        cout<<1;
    else if(c>4&&c<=12)
        cout<<1;
    else cout<<0;
    cout<<" ";
    if((c%2==0)^(c>4&&c<=12))
        cout<<1;
    else cout<<0;
    cout<<" ";
    
    if(c%2!=0&&(c<=4||c>12))
        cout<<1;
    else cout<<0;
    return 0;
}